<?php echo $this->fetch('header.html'); ?>    
<?php echo $this->fetch('title.html'); ?>

<style>
    #page-sdemand{}
    #page-sdemand .sdemand-form{padding:10px;background:#fff;margin-bottom:10px;}
    #page-sdemand .sdemand-form li{margin-bottom:10px;}
    #page-sdemand .sdemand-list{padding:10px;background:#fff;margin:10px 0;}
    #page-sdemand .sdemand-list dl{border-bottom: 1px solid #ddd;margin-top:10px;padding:10px 0;width:100%;}
    #page-sdemand .sdemand-list dl dt{font-size: 14px;line-height:22px;}
    #page-sdemand .sdemand-list dl dt span{color:red}
    #page-sdemand .sdemand-list dl dd{font-size: 14px;line-height:22px;}
</style>
<div id="page-sdemand">
    <div class="sdemand-form">
        <form method="get">
            <input type="hidden" name="app" value="sdemand" />
            <ul>
                <li>
                    <input type="text" name="title" value="<?php echo htmlspecialchars($_GET['title']); ?>" placeholder="标题"/>
                </li>
                <li>
                    <select name="type">
                        <option value="">请选择...</option>
                        <?php echo $this->html_options(array('options'=>$this->_var['type'],'selected'=>$_GET['type'])); ?>
                    </select>
                </li>
                <li>
                    <input type="submit" class="red_btn" value="查询" />
                </li>
            </ul>
        </form>
    </div>
    
    <div class="sdemand-list">
        <a href="<?php echo url('app=supply_demand&act=add'); ?>" class="red_btn">免费发布信息</a>
        <?php $_from = $this->_var['infos']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }; $this->push_vars('', 'info');if (count($_from)):
    foreach ($_from AS $this->_var['info']):
?>
        <a href="<?php echo url('app=sdemand&act=view&id=' . $this->_var['info']['id']. ''); ?>" target="_blank">
            <dl>
                <dt><span><?php if ($this->_var['info']['type'] == 1): ?>[供应]<?php else: ?>[求购]<?php endif; ?></span><?php echo sub_str(htmlspecialchars($this->_var['info']['title']),20); ?></dt>
                <dd>价格:<?php if ($this->_var['info']['price'] != 0): ?><?php echo price_format($this->_var['info']['price']); ?><?php elseif ($this->_var['info']['price_from'] != 0 && $this->_var['info']['price_to'] != 0): ?><?php echo price_format($this->_var['info']['price_from']); ?> - <?php echo price_format($this->_var['info']['price_to']); ?><?php else: ?>面议<?php endif; ?></dd>
                <dd>联系人:<?php echo $this->_var['info']['name']; ?></dd>
                <dd>电话/手机:<?php echo $this->_var['info']['phone']; ?></dd>
                <dd>地区:<?php echo $this->_var['info']['region_name']; ?></dd>
                <dd>发布时间:<?php echo local_date("Y-m-d H:i",$this->_var['info']['add_time']); ?></dd>
            </dl>
        </a>
        <?php endforeach; else: ?>
        <div class="null">
            没有符合条件的记录
        </div>
        <?php endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </div>
    <?php echo $this->fetch('page.bottom.html'); ?>
</div>


<?php echo $this->fetch('footer.html'); ?>